import 'package:car_baidu/ui/widget/navigation_title.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class LLWebViewScreen extends StatefulWidget {
  static const String routeName = "webView";
  LLWebViewScreen({Key? key}) : super(key: key);
  @override
  _LLWebViewScreenState createState() => _LLWebViewScreenState();
}

class _LLWebViewScreenState extends State<LLWebViewScreen> {
  @override
  Widget build(BuildContext context) {
    Map<String, dynamic> argument =
        ModalRoute.of(context)!.settings.arguments as Map<String, dynamic>;
    return Scaffold(
      appBar: AppBar(
        title: LLNavigationTitleWiget(argument["title"]),
      ),
      body: WebView(
        initialUrl: argument["url"],
        onPageStarted: (u) {
          print("onPageStarted");
        },
        onWebResourceError: (e) {
          print("onWebResourceError, ${e.description}");
        },
        onProgress: (u) {
          print("onProgress");
        },
        onWebViewCreated: (WebViewController controller) {
          print("onWebViewCreated");
        },
      ),
    );
  }
}
